//package hsb.learn.common.filter;
//
//import com.usthe.sureness.subject.Subject;
//import hsb.learn.common.config.security.SurenessContextHolder;
//import hsb.learn.common.core.domain.TokenService;
//import hsb.learn.common.core.domain.model.LoginUser;
//import hsb.learn.common.utils.StringUtils;
//import io.quarkus.vertx.http.runtime.filters.Filters;
//import io.vertx.core.Handler;
//import io.vertx.ext.web.RoutingContext;
//
//import javax.enterprise.context.ApplicationScoped;
//import javax.enterprise.event.Observes;
//import javax.inject.Inject;
//
//
///**
// * @author 胡帅博
// * @date 2023/1/2 17:43
// */
//@ApplicationScoped
//public class JwtAuthenticationTokenFilter {
//
//    @Inject
//    TokenService tokenService;
//
//    public void filter(@Observes Filters filters) {
//        filters.register(new Handler<RoutingContext>() {
//            @Override
//            public void handle(RoutingContext rc) {
//                //SurenessContextHolder.clear();
//                Subject subject = tokenService.geSubject(rc.request());
//                if (StringUtils.isNotNull(subject)) {
//                    tokenService.verifyToken((LoginUser) subject.getPrincipal());
//
//                    SurenessContextHolder.bindSubject(subject);
//                }
//                System.out.println(1);
//                System.out.println(SurenessContextHolder.getBindSubject());
//                System.out.println(SurenessContextHolder.getBindSubject());
//                System.out.println(SurenessContextHolder.class.getClassLoader());
//                rc.next();
//                System.out.println(2);
//            }
//        }, 1001);
//    }
//}
